package com.siashan.toolkit.crypt.digest;

/**
 * 摘要算法类型
 *
 * <p>
 *     Java 8 及以上支持：SHA-224.
 * </p>
 * <p>
 *     Java 9 及以上支持：  SHA3-224, SHA3-256, SHA3-384, SHA3-512.
 * </p>
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest">
 *       Java 7 Cryptography Architecture Standard Algorithm Name Documentation</a>
 * @see <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest">
 *      Java 8 Cryptography Architecture Standard Algorithm Name Documentation</a>
 * @see <a href="https://docs.oracle.com/javase/9/docs/specs/security/standard-names.html#messagedigest-algorithms">
 *        Java 9 Cryptography Architecture Standard Algorithm Name Documentation</a>
 * @see <a href="https://docs.oracle.com/javase/10/docs/specs/security/standard-names.html#messagedigest-algorithms">
 *       Java 10 Cryptography Architecture Standard Algorithm Name Documentation</a>
 * @see <a href="https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#messagedigest-algorithms">
 *       Java 11 Cryptography Architecture Standard Algorithm Name Documentation</a>
 * @see <a href="https://docs.oracle.com/en/java/javase/12/docs/specs/security/standard-names.html#messagedigest-algorithms">
 *       Java 12 Cryptography Architecture Standard Algorithm Name Documentation</a>
 * @see <a href="https://docs.oracle.com/en/java/javase/13/docs/specs/security/standard-names.html#messagedigest-algorithms">
 *       Java 13 Cryptography Architecture Standard Algorithm Name Documentation</a>
 *
 * @see <a href="http://dx.doi.org/10.6028/NIST.FIPS.180-4">FIPS PUB 180-4</a>
 * @see <a href="http://dx.doi.org/10.6028/NIST.FIPS.202">FIPS PUB 202</a>
 *
 * @author siashan
 * @since v1.0.7
 **/
public enum DigestAlgorithm {
    /**
     * MD2 摘要算法
     */
    MD2("MD2"),
    /**
     * MD5 摘要算法
     */
    MD5("MD5"),
    /**
     * SHA-1 哈希算法
     */
    SHA_1("SHA-1"),
    /**
     * SHA-256 哈希算法
     */
    SHA_256("SHA-256"),
    /**
     * SHA-384 哈希算法
     */
    SHA_384("SHA-384"),
    /**
     * SHA-512 哈希算法
     */
    SHA_512("SHA-512"),
    /**
     * SHA-512/224 哈希算法
     */
    SHA_512_224("SHA-512/224"),
    /**
     * SHA-512/256 哈希算法
     */
    SHA_512_256("SHA-512/256"),
    /**
     * SHA3-224 哈希算法
     */
    SHA3_224("SHA3-224"),
    /**
     * SHA3-256 哈希算法
     */
    SHA3_256("SHA3-256"),
    /**
     * SHA3-384 哈希算法
     */
    SHA3_384("SHA3-384"),
    /**
     * SHA3-512 哈希算法
     */
    SHA3_512("SHA3-512"),
    /**
     * SM3 算法
     */
    SM3("SM3"),
    ;
    private final String value;

    DigestAlgorithm(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }
}
